using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Data.SqlTypes;
using System.Data.SqlClient;
using System.Text;
using ECommerce.DAL;


namespace Entity
{
	/// <summary>
	/// This object represents the Private Fields of TblProductPurchaseOrder.
	/// </summary>
	
	[System.ComponentModel.DataObject]
    public class TblProductPurchaseOrder : DatabaseUtility
    {
		#region TblProductPurchaseOrder Private Fields


		Int32 _orderId;
		String _orderCode = String.Empty;
		String _firstName = String.Empty;
		String _lastName = String.Empty;
		DateTime _dateOfBirth;
		String _emailAddress = String.Empty;
		String _userGender = String.Empty;
		String _userTelephoneNumber = String.Empty;
		String _userFaxNumber = String.Empty;
		String _companyName = String.Empty;
		String _companyTelephoneNumber = String.Empty;
		String _companyFaxNumber = String.Empty;
		String _billingFirstName = String.Empty;
		String _billingLastName = String.Empty;
		String _billingAddressLine1 = String.Empty;
		String _billingAddressLine2 = String.Empty;
		String _billingCity = String.Empty;
		String _billingAddressState = String.Empty;
		String _billingAddressCountry = String.Empty;
		String _billingZipCode = String.Empty;
		String _billingTelephoneNumber = String.Empty;
		String _billingTelephoneNumber2 = String.Empty;
		String _billingEmailAddress = String.Empty;
		String _shippingFirstName = String.Empty;
		String _shippingLastName = String.Empty;
		String _shippingAddressLine1 = String.Empty;
		String _shippingAddressLine2 = String.Empty;
		String _shippingCity = String.Empty;
		String _shippingAddressState = String.Empty;
		String _shippingAddressCountry = String.Empty;
		String _shippingZipCode = String.Empty;
		String _shippingTelephoneNumber = String.Empty;
		String _shippingTelephoneNumber2 = String.Empty;
		String _shippingEmailAddress = String.Empty;
		DateTime _createDate;
		String _paymentType = String.Empty;
		String _shippingMethod = String.Empty;
		Int32 _creditCardId;
		Int32 _giftCertificateId;
		Decimal _orderPrice;
		Decimal _paymentByCreditCard;
		Decimal _paymentByGiftCertificate;
		Decimal _taxAmount;
		Decimal _shippingCost;
		String _shippingStatus = String.Empty;
		String _orderStatus = String.Empty;
		String _orderStatusMessage = String.Empty;
		String _orderStatusCode = String.Empty;
		String _orderTrackNumber = String.Empty;
		String _specialInstruction = String.Empty;
		Decimal _couponDiscount;
		String _giftCardImageUrl = String.Empty;
		String _gIftCardMessage = String.Empty;
		String _officeUse = String.Empty;
		Boolean _isMultipleShip;
		Boolean _isResidential;
		DateTime _requestedDeliveryDate;
		Int32 _printNo;
		String _substitute = String.Empty;
		Int32 _sPId;
		String _sPName = String.Empty;
		
		#endregion
		#region TblProductPurchaseOrder Constractor
		/// <summary>
        /// Creates an empty object of TblProductPurchaseOrder. 
        /// This is mainly used to create a new instance of TblProductPurchaseOrder to add a new TblProductPurchaseOrder.
        /// </summary>
		public TblProductPurchaseOrder(){}
		
				
		/// <summary>
        /// Used to retrieve employee information from database, 
        /// which is also used by Update method to save information of an existing TblProductPurchaseOrder.
        /// </summary>
		public TblProductPurchaseOrder
		(
			Int32 orderId,
			String orderCode,
			String firstName,
			String lastName,
			DateTime dateOfBirth,
			String emailAddress,
			String userGender,
			String userTelephoneNumber,
			String userFaxNumber,
			String companyName,
			String companyTelephoneNumber,
			String companyFaxNumber,
			String billingFirstName,
			String billingLastName,
			String billingAddressLine1,
			String billingAddressLine2,
			String billingCity,
			String billingAddressState,
			String billingAddressCountry,
			String billingZipCode,
			String billingTelephoneNumber,
			String billingTelephoneNumber2,
			String billingEmailAddress,
			String shippingFirstName,
			String shippingLastName,
			String shippingAddressLine1,
			String shippingAddressLine2,
			String shippingCity,
			String shippingAddressState,
			String shippingAddressCountry,
			String shippingZipCode,
			String shippingTelephoneNumber,
			String shippingTelephoneNumber2,
			String shippingEmailAddress,
			DateTime createDate,
			String paymentType,
			String shippingMethod,
			Int32 creditCardId,
			Int32 giftCertificateId,
			Decimal orderPrice,
			Decimal paymentByCreditCard,
			Decimal paymentByGiftCertificate,
			Decimal taxAmount,
			Decimal shippingCost,
			String shippingStatus,
			String orderStatus,
			String orderStatusMessage,
			String orderStatusCode,
			String orderTrackNumber,
			String specialInstruction,
			Decimal couponDiscount,
			String giftCardImageUrl,
			String gIftCardMessage,
			String officeUse,
			Boolean isMultipleShip,
			Boolean isResidential,
			DateTime requestedDeliveryDate,
			Int32 printNo,
			String substitute,
			Int32 sPId,
			String sPName
		)
		{
			_orderId = orderId;	
			_orderCode = orderCode;	
			_firstName = firstName;	
			_lastName = lastName;	
			_dateOfBirth = dateOfBirth;	
			_emailAddress = emailAddress;	
			_userGender = userGender;	
			_userTelephoneNumber = userTelephoneNumber;	
			_userFaxNumber = userFaxNumber;	
			_companyName = companyName;	
			_companyTelephoneNumber = companyTelephoneNumber;	
			_companyFaxNumber = companyFaxNumber;	
			_billingFirstName = billingFirstName;	
			_billingLastName = billingLastName;	
			_billingAddressLine1 = billingAddressLine1;	
			_billingAddressLine2 = billingAddressLine2;	
			_billingCity = billingCity;	
			_billingAddressState = billingAddressState;	
			_billingAddressCountry = billingAddressCountry;	
			_billingZipCode = billingZipCode;	
			_billingTelephoneNumber = billingTelephoneNumber;	
			_billingTelephoneNumber2 = billingTelephoneNumber2;	
			_billingEmailAddress = billingEmailAddress;	
			_shippingFirstName = shippingFirstName;	
			_shippingLastName = shippingLastName;	
			_shippingAddressLine1 = shippingAddressLine1;	
			_shippingAddressLine2 = shippingAddressLine2;	
			_shippingCity = shippingCity;	
			_shippingAddressState = shippingAddressState;	
			_shippingAddressCountry = shippingAddressCountry;	
			_shippingZipCode = shippingZipCode;	
			_shippingTelephoneNumber = shippingTelephoneNumber;	
			_shippingTelephoneNumber2 = shippingTelephoneNumber2;	
			_shippingEmailAddress = shippingEmailAddress;	
			_createDate = createDate;	
			_paymentType = paymentType;	
			_shippingMethod = shippingMethod;	
			_creditCardId = creditCardId;	
			_giftCertificateId = giftCertificateId;	
			_orderPrice = orderPrice;	
			_paymentByCreditCard = paymentByCreditCard;	
			_paymentByGiftCertificate = paymentByGiftCertificate;	
			_taxAmount = taxAmount;	
			_shippingCost = shippingCost;	
			_shippingStatus = shippingStatus;	
			_orderStatus = orderStatus;	
			_orderStatusMessage = orderStatusMessage;	
			_orderStatusCode = orderStatusCode;	
			_orderTrackNumber = orderTrackNumber;	
			_specialInstruction = specialInstruction;	
			_couponDiscount = couponDiscount;	
			_giftCardImageUrl = giftCardImageUrl;	
			_gIftCardMessage = gIftCardMessage;	
			_officeUse = officeUse;	
			_isMultipleShip = isMultipleShip;	
			_isResidential = isResidential;	
			_requestedDeliveryDate = requestedDeliveryDate;	
			_printNo = printNo;	
			_substitute = substitute;	
			_sPId = sPId;	
			_sPName = sPName;	
		}
		
		#endregion
		#region TblProductPurchaseOrder Properties
		
		 /***********************************************************************************************
                                    -- PROPERTIES --        
         Contains all the properties representing the data fields of the current entity.
         ***********************************************************************************************/

        /// <summary>
        /// This is the Primary key value of the OrderId, which can't be assigned from the application,
        /// to ensure the data consistancy, by not letting the user to change the PK_TblProductPurchaseOrder to update the data of an another TblProductPurchaseOrder instance.
        /// For view or updation purpose, every TblProductPurchaseOrder will be retrieved thru the proper 'Get' method.
        /// </summary>
		
		public Int32 OrderId
		{
			get {return _orderId;}	
		}
		
				
		public String OrderCode
		{
			get {return _orderCode;}
			set {_orderCode = value;}
		}

		public String FirstName
		{
			get {return _firstName;}
			set {_firstName = value;}
		}

		public String LastName
		{
			get {return _lastName;}
			set {_lastName = value;}
		}

		public DateTime DateOfBirth
		{
			get {return _dateOfBirth;}
			set {_dateOfBirth = value;}
		}

		public String EmailAddress
		{
			get {return _emailAddress;}
			set {_emailAddress = value;}
		}

		public String UserGender
		{
			get {return _userGender;}
			set {_userGender = value;}
		}

		public String UserTelephoneNumber
		{
			get {return _userTelephoneNumber;}
			set {_userTelephoneNumber = value;}
		}

		public String UserFaxNumber
		{
			get {return _userFaxNumber;}
			set {_userFaxNumber = value;}
		}

		public String CompanyName
		{
			get {return _companyName;}
			set {_companyName = value;}
		}

		public String CompanyTelephoneNumber
		{
			get {return _companyTelephoneNumber;}
			set {_companyTelephoneNumber = value;}
		}

		public String CompanyFaxNumber
		{
			get {return _companyFaxNumber;}
			set {_companyFaxNumber = value;}
		}

		public String BillingFirstName
		{
			get {return _billingFirstName;}
			set {_billingFirstName = value;}
		}

		public String BillingLastName
		{
			get {return _billingLastName;}
			set {_billingLastName = value;}
		}

		public String BillingAddressLine1
		{
			get {return _billingAddressLine1;}
			set {_billingAddressLine1 = value;}
		}

		public String BillingAddressLine2
		{
			get {return _billingAddressLine2;}
			set {_billingAddressLine2 = value;}
		}

		public String BillingCity
		{
			get {return _billingCity;}
			set {_billingCity = value;}
		}

		public String BillingAddressState
		{
			get {return _billingAddressState;}
			set {_billingAddressState = value;}
		}

		public String BillingAddressCountry
		{
			get {return _billingAddressCountry;}
			set {_billingAddressCountry = value;}
		}

		public String BillingZipCode
		{
			get {return _billingZipCode;}
			set {_billingZipCode = value;}
		}

		public String BillingTelephoneNumber
		{
			get {return _billingTelephoneNumber;}
			set {_billingTelephoneNumber = value;}
		}

		public String BillingTelephoneNumber2
		{
			get {return _billingTelephoneNumber2;}
			set {_billingTelephoneNumber2 = value;}
		}

		public String BillingEmailAddress
		{
			get {return _billingEmailAddress;}
			set {_billingEmailAddress = value;}
		}

		public String ShippingFirstName
		{
			get {return _shippingFirstName;}
			set {_shippingFirstName = value;}
		}

		public String ShippingLastName
		{
			get {return _shippingLastName;}
			set {_shippingLastName = value;}
		}

		public String ShippingAddressLine1
		{
			get {return _shippingAddressLine1;}
			set {_shippingAddressLine1 = value;}
		}

		public String ShippingAddressLine2
		{
			get {return _shippingAddressLine2;}
			set {_shippingAddressLine2 = value;}
		}

		public String ShippingCity
		{
			get {return _shippingCity;}
			set {_shippingCity = value;}
		}

		public String ShippingAddressState
		{
			get {return _shippingAddressState;}
			set {_shippingAddressState = value;}
		}

		public String ShippingAddressCountry
		{
			get {return _shippingAddressCountry;}
			set {_shippingAddressCountry = value;}
		}

		public String ShippingZipCode
		{
			get {return _shippingZipCode;}
			set {_shippingZipCode = value;}
		}

		public String ShippingTelephoneNumber
		{
			get {return _shippingTelephoneNumber;}
			set {_shippingTelephoneNumber = value;}
		}

		public String ShippingTelephoneNumber2
		{
			get {return _shippingTelephoneNumber2;}
			set {_shippingTelephoneNumber2 = value;}
		}

		public String ShippingEmailAddress
		{
			get {return _shippingEmailAddress;}
			set {_shippingEmailAddress = value;}
		}

		public DateTime CreateDate
		{
			get {return _createDate;}
			set {_createDate = value;}
		}

		public String PaymentType
		{
			get {return _paymentType;}
			set {_paymentType = value;}
		}

		public String ShippingMethod
		{
			get {return _shippingMethod;}
			set {_shippingMethod = value;}
		}

		public Int32 CreditCardId
		{
			get {return _creditCardId;}
			set {_creditCardId = value;}
		}

		public Int32 GiftCertificateId
		{
			get {return _giftCertificateId;}
			set {_giftCertificateId = value;}
		}

		public Decimal OrderPrice
		{
			get {return _orderPrice;}
			set {_orderPrice = value;}
		}

		public Decimal PaymentByCreditCard
		{
			get {return _paymentByCreditCard;}
			set {_paymentByCreditCard = value;}
		}

		public Decimal PaymentByGiftCertificate
		{
			get {return _paymentByGiftCertificate;}
			set {_paymentByGiftCertificate = value;}
		}

		public Decimal TaxAmount
		{
			get {return _taxAmount;}
			set {_taxAmount = value;}
		}

		public Decimal ShippingCost
		{
			get {return _shippingCost;}
			set {_shippingCost = value;}
		}

		public String ShippingStatus
		{
			get {return _shippingStatus;}
			set {_shippingStatus = value;}
		}

		public String OrderStatus
		{
			get {return _orderStatus;}
			set {_orderStatus = value;}
		}

		public String OrderStatusMessage
		{
			get {return _orderStatusMessage;}
			set {_orderStatusMessage = value;}
		}

		public String OrderStatusCode
		{
			get {return _orderStatusCode;}
			set {_orderStatusCode = value;}
		}

		public String OrderTrackNumber
		{
			get {return _orderTrackNumber;}
			set {_orderTrackNumber = value;}
		}

		public String SpecialInstruction
		{
			get {return _specialInstruction;}
			set {_specialInstruction = value;}
		}

		public Decimal CouponDiscount
		{
			get {return _couponDiscount;}
			set {_couponDiscount = value;}
		}

		public String GiftCardImageUrl
		{
			get {return _giftCardImageUrl;}
			set {_giftCardImageUrl = value;}
		}

		public String GIftCardMessage
		{
			get {return _gIftCardMessage;}
			set {_gIftCardMessage = value;}
		}

		public String OfficeUse
		{
			get {return _officeUse;}
			set {_officeUse = value;}
		}

		public Boolean IsMultipleShip
		{
			get {return _isMultipleShip;}
			set {_isMultipleShip = value;}
		}

		public Boolean IsResidential
		{
			get {return _isResidential;}
			set {_isResidential = value;}
		}

		public DateTime RequestedDeliveryDate
		{
			get {return _requestedDeliveryDate;}
			set {_requestedDeliveryDate = value;}
		}

		public Int32 PrintNo
		{
			get {return _printNo;}
			set {_printNo = value;}
		}

		public String Substitute
		{
			get {return _substitute;}
			set {_substitute = value;}
		}

		public Int32 SPId
		{
			get {return _sPId;}
			set {_sPId = value;}
		}

		public String SPName
		{
			get {return _sPName;}
			set {_sPName = value;}
		}
		

		#endregion
		#region TblProductPurchaseOrder Static Methods
		/************************************************************************************
                                    -- CREATE METHOD (STATIC) --
        *************************************************************************************/
		/************************* Architecure note:**********************************
        Note 1:
        This method is specially useful for the case, where we need to use Object Data Source controls.
        For ObjectDataSource/SqlDataSource controls, the insert/update metnod requires paramters methods, rather property based methods.
        However, there is still a way to pass property based objects as method parameter for data source controls, 
        but in that case we could not use Sql type, as view controls or asp parameter control can only contain few of primitive type.
        The main reason to remain the Sql Type in our object architecture is it is faster and contains better way for null value support.
        
        Note 2: 
        Non-primary key: it should be primitive type, as the asp paramter control (included in data source control) supports only primitive types.
        /*****************************************************************************/
		[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)]
        public static  Int32 CreateNewTblProductPurchaseOrder
		(
			String orderCode,
			String firstName,
			String lastName,
			DateTime dateOfBirth,
			String emailAddress,
			String userGender,
			String userTelephoneNumber,
			String userFaxNumber,
			String companyName,
			String companyTelephoneNumber,
			String companyFaxNumber,
			String billingFirstName,
			String billingLastName,
			String billingAddressLine1,
			String billingAddressLine2,
			String billingCity,
			String billingAddressState,
			String billingAddressCountry,
			String billingZipCode,
			String billingTelephoneNumber,
			String billingTelephoneNumber2,
			String billingEmailAddress,
			String shippingFirstName,
			String shippingLastName,
			String shippingAddressLine1,
			String shippingAddressLine2,
			String shippingCity,
			String shippingAddressState,
			String shippingAddressCountry,
			String shippingZipCode,
			String shippingTelephoneNumber,
			String shippingTelephoneNumber2,
			String shippingEmailAddress,
			DateTime createDate,
			String paymentType,
			String shippingMethod,
			Int32 creditCardId,
			Int32 giftCertificateId,
			Decimal orderPrice,
			Decimal paymentByCreditCard,
			Decimal paymentByGiftCertificate,
			Decimal taxAmount,
			Decimal shippingCost,
			String shippingStatus,
			String orderStatus,
			String orderStatusMessage,
			String orderStatusCode,
			String orderTrackNumber,
			String specialInstruction,
			Decimal couponDiscount,
			String giftCardImageUrl,
			String gIftCardMessage,
			String officeUse,
			Boolean isMultipleShip,
			Boolean isResidential,
			DateTime requestedDeliveryDate,
			Int32 printNo,
			String substitute,
			Int32 sPId,
			String sPName
		)
		{
			//creating an empty TblProductPurchaseOrder object
            TblProductPurchaseOrder tblProductPurchaseOrder = new TblProductPurchaseOrder();
				tblProductPurchaseOrder.OrderCode = orderCode;
				tblProductPurchaseOrder.FirstName = firstName;
				tblProductPurchaseOrder.LastName = lastName;
				tblProductPurchaseOrder.DateOfBirth = dateOfBirth;
				tblProductPurchaseOrder.EmailAddress = emailAddress;
				tblProductPurchaseOrder.UserGender = userGender;
				tblProductPurchaseOrder.UserTelephoneNumber = userTelephoneNumber;
				tblProductPurchaseOrder.UserFaxNumber = userFaxNumber;
				tblProductPurchaseOrder.CompanyName = companyName;
				tblProductPurchaseOrder.CompanyTelephoneNumber = companyTelephoneNumber;
				tblProductPurchaseOrder.CompanyFaxNumber = companyFaxNumber;
				tblProductPurchaseOrder.BillingFirstName = billingFirstName;
				tblProductPurchaseOrder.BillingLastName = billingLastName;
				tblProductPurchaseOrder.BillingAddressLine1 = billingAddressLine1;
				tblProductPurchaseOrder.BillingAddressLine2 = billingAddressLine2;
				tblProductPurchaseOrder.BillingCity = billingCity;
				tblProductPurchaseOrder.BillingAddressState = billingAddressState;
				tblProductPurchaseOrder.BillingAddressCountry = billingAddressCountry;
				tblProductPurchaseOrder.BillingZipCode = billingZipCode;
				tblProductPurchaseOrder.BillingTelephoneNumber = billingTelephoneNumber;
				tblProductPurchaseOrder.BillingTelephoneNumber2 = billingTelephoneNumber2;
				tblProductPurchaseOrder.BillingEmailAddress = billingEmailAddress;
				tblProductPurchaseOrder.ShippingFirstName = shippingFirstName;
				tblProductPurchaseOrder.ShippingLastName = shippingLastName;
				tblProductPurchaseOrder.ShippingAddressLine1 = shippingAddressLine1;
				tblProductPurchaseOrder.ShippingAddressLine2 = shippingAddressLine2;
				tblProductPurchaseOrder.ShippingCity = shippingCity;
				tblProductPurchaseOrder.ShippingAddressState = shippingAddressState;
				tblProductPurchaseOrder.ShippingAddressCountry = shippingAddressCountry;
				tblProductPurchaseOrder.ShippingZipCode = shippingZipCode;
				tblProductPurchaseOrder.ShippingTelephoneNumber = shippingTelephoneNumber;
				tblProductPurchaseOrder.ShippingTelephoneNumber2 = shippingTelephoneNumber2;
				tblProductPurchaseOrder.ShippingEmailAddress = shippingEmailAddress;
				tblProductPurchaseOrder.CreateDate = createDate;
				tblProductPurchaseOrder.PaymentType = paymentType;
				tblProductPurchaseOrder.ShippingMethod = shippingMethod;
				tblProductPurchaseOrder.CreditCardId = creditCardId;
				tblProductPurchaseOrder.GiftCertificateId = giftCertificateId;
				tblProductPurchaseOrder.OrderPrice = orderPrice;
				tblProductPurchaseOrder.PaymentByCreditCard = paymentByCreditCard;
				tblProductPurchaseOrder.PaymentByGiftCertificate = paymentByGiftCertificate;
				tblProductPurchaseOrder.TaxAmount = taxAmount;
				tblProductPurchaseOrder.ShippingCost = shippingCost;
				tblProductPurchaseOrder.ShippingStatus = shippingStatus;
				tblProductPurchaseOrder.OrderStatus = orderStatus;
				tblProductPurchaseOrder.OrderStatusMessage = orderStatusMessage;
				tblProductPurchaseOrder.OrderStatusCode = orderStatusCode;
				tblProductPurchaseOrder.OrderTrackNumber = orderTrackNumber;
				tblProductPurchaseOrder.SpecialInstruction = specialInstruction;
				tblProductPurchaseOrder.CouponDiscount = couponDiscount;
				tblProductPurchaseOrder.GiftCardImageUrl = giftCardImageUrl;
				tblProductPurchaseOrder.GIftCardMessage = gIftCardMessage;
				tblProductPurchaseOrder.OfficeUse = officeUse;
				tblProductPurchaseOrder.IsMultipleShip = isMultipleShip;
				tblProductPurchaseOrder.IsResidential = isResidential;
				tblProductPurchaseOrder.RequestedDeliveryDate = requestedDeliveryDate;
				tblProductPurchaseOrder.PrintNo = printNo;
				tblProductPurchaseOrder.Substitute = substitute;
				tblProductPurchaseOrder.SPId = sPId;
				tblProductPurchaseOrder.SPName = sPName;
			
			return TblProductPurchaseOrder.CreateNewTblProductPurchaseOrder(tblProductPurchaseOrder);
		}
	
		/************************************************************************************
                 -- UPDATE METHODS (STATIC) --
        *************************************************************************************/

        /************************* Architecure note:**********************************
        Note 1:
        This method is specially useful for the case, where we need to use Object Data Source controls.
        For ObjectDataSource/SqlDataSource controls, the insert/update metnod requires paramters methods, rather property based methods.
        However, there is still a way to pass property based objects as method parameter for data source controls, 
        but in that case we could not use Sql type, as view controls or asp parameter control can only contain few of primitive type.
        The main reason to remain the Sql Type in our object architecture is it is faster and contains better way for null value support.
        
        Note 2: 
        There the two types of paramaters will be passed here.
         * a. Primary key paramater: it should be Sql type, as we will bind the primary key property for the view controls (form view, details view etc) as datakey.
         * b. Non-primary key: it should be primitive type, as the asp paramter control (included in data source control) supports only primitive types.
        /*****************************************************************************/
		
		[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
        public static  bool UpdateTblProductPurchaseOrder
		(
			Int32 orderId,
			String orderCode,
			String firstName,
			String lastName,
			DateTime dateOfBirth,
			String emailAddress,
			String userGender,
			String userTelephoneNumber,
			String userFaxNumber,
			String companyName,
			String companyTelephoneNumber,
			String companyFaxNumber,
			String billingFirstName,
			String billingLastName,
			String billingAddressLine1,
			String billingAddressLine2,
			String billingCity,
			String billingAddressState,
			String billingAddressCountry,
			String billingZipCode,
			String billingTelephoneNumber,
			String billingTelephoneNumber2,
			String billingEmailAddress,
			String shippingFirstName,
			String shippingLastName,
			String shippingAddressLine1,
			String shippingAddressLine2,
			String shippingCity,
			String shippingAddressState,
			String shippingAddressCountry,
			String shippingZipCode,
			String shippingTelephoneNumber,
			String shippingTelephoneNumber2,
			String shippingEmailAddress,
			DateTime createDate,
			String paymentType,
			String shippingMethod,
			Int32 creditCardId,
			Int32 giftCertificateId,
			Decimal orderPrice,
			Decimal paymentByCreditCard,
			Decimal paymentByGiftCertificate,
			Decimal taxAmount,
			Decimal shippingCost,
			String shippingStatus,
			String orderStatus,
			String orderStatusMessage,
			String orderStatusCode,
			String orderTrackNumber,
			String specialInstruction,
			Decimal couponDiscount,
			String giftCardImageUrl,
			String gIftCardMessage,
			String officeUse,
			Boolean isMultipleShip,
			Boolean isResidential,
			DateTime requestedDeliveryDate,
			Int32 printNo,
			String substitute,
			Int32 sPId,
			String sPName
		)
		{
			 TblProductPurchaseOrder tblProductPurchaseOrder =  TblProductPurchaseOrder.GetTblProductPurchaseOrderByOrderId(orderId);
			
				tblProductPurchaseOrder.OrderCode = orderCode;
				tblProductPurchaseOrder.FirstName = firstName;
				tblProductPurchaseOrder.LastName = lastName;
				tblProductPurchaseOrder.DateOfBirth = dateOfBirth;
				tblProductPurchaseOrder.EmailAddress = emailAddress;
				tblProductPurchaseOrder.UserGender = userGender;
				tblProductPurchaseOrder.UserTelephoneNumber = userTelephoneNumber;
				tblProductPurchaseOrder.UserFaxNumber = userFaxNumber;
				tblProductPurchaseOrder.CompanyName = companyName;
				tblProductPurchaseOrder.CompanyTelephoneNumber = companyTelephoneNumber;
				tblProductPurchaseOrder.CompanyFaxNumber = companyFaxNumber;
				tblProductPurchaseOrder.BillingFirstName = billingFirstName;
				tblProductPurchaseOrder.BillingLastName = billingLastName;
				tblProductPurchaseOrder.BillingAddressLine1 = billingAddressLine1;
				tblProductPurchaseOrder.BillingAddressLine2 = billingAddressLine2;
				tblProductPurchaseOrder.BillingCity = billingCity;
				tblProductPurchaseOrder.BillingAddressState = billingAddressState;
				tblProductPurchaseOrder.BillingAddressCountry = billingAddressCountry;
				tblProductPurchaseOrder.BillingZipCode = billingZipCode;
				tblProductPurchaseOrder.BillingTelephoneNumber = billingTelephoneNumber;
				tblProductPurchaseOrder.BillingTelephoneNumber2 = billingTelephoneNumber2;
				tblProductPurchaseOrder.BillingEmailAddress = billingEmailAddress;
				tblProductPurchaseOrder.ShippingFirstName = shippingFirstName;
				tblProductPurchaseOrder.ShippingLastName = shippingLastName;
				tblProductPurchaseOrder.ShippingAddressLine1 = shippingAddressLine1;
				tblProductPurchaseOrder.ShippingAddressLine2 = shippingAddressLine2;
				tblProductPurchaseOrder.ShippingCity = shippingCity;
				tblProductPurchaseOrder.ShippingAddressState = shippingAddressState;
				tblProductPurchaseOrder.ShippingAddressCountry = shippingAddressCountry;
				tblProductPurchaseOrder.ShippingZipCode = shippingZipCode;
				tblProductPurchaseOrder.ShippingTelephoneNumber = shippingTelephoneNumber;
				tblProductPurchaseOrder.ShippingTelephoneNumber2 = shippingTelephoneNumber2;
				tblProductPurchaseOrder.ShippingEmailAddress = shippingEmailAddress;
				tblProductPurchaseOrder.CreateDate = createDate;
				tblProductPurchaseOrder.PaymentType = paymentType;
				tblProductPurchaseOrder.ShippingMethod = shippingMethod;
				tblProductPurchaseOrder.CreditCardId = creditCardId;
				tblProductPurchaseOrder.GiftCertificateId = giftCertificateId;
				tblProductPurchaseOrder.OrderPrice = orderPrice;
				tblProductPurchaseOrder.PaymentByCreditCard = paymentByCreditCard;
				tblProductPurchaseOrder.PaymentByGiftCertificate = paymentByGiftCertificate;
				tblProductPurchaseOrder.TaxAmount = taxAmount;
				tblProductPurchaseOrder.ShippingCost = shippingCost;
				tblProductPurchaseOrder.ShippingStatus = shippingStatus;
				tblProductPurchaseOrder.OrderStatus = orderStatus;
				tblProductPurchaseOrder.OrderStatusMessage = orderStatusMessage;
				tblProductPurchaseOrder.OrderStatusCode = orderStatusCode;
				tblProductPurchaseOrder.OrderTrackNumber = orderTrackNumber;
				tblProductPurchaseOrder.SpecialInstruction = specialInstruction;
				tblProductPurchaseOrder.CouponDiscount = couponDiscount;
				tblProductPurchaseOrder.GiftCardImageUrl = giftCardImageUrl;
				tblProductPurchaseOrder.GIftCardMessage = gIftCardMessage;
				tblProductPurchaseOrder.OfficeUse = officeUse;
				tblProductPurchaseOrder.IsMultipleShip = isMultipleShip;
				tblProductPurchaseOrder.IsResidential = isResidential;
				tblProductPurchaseOrder.RequestedDeliveryDate = requestedDeliveryDate;
				tblProductPurchaseOrder.PrintNo = printNo;
				tblProductPurchaseOrder.Substitute = substitute;
				tblProductPurchaseOrder.SPId = sPId;
				tblProductPurchaseOrder.SPName = sPName;
			
			return TblProductPurchaseOrder.UpdateTblProductPurchaseOrder(tblProductPurchaseOrder);
		}

		/************************************************************************************
                         -- DELETE METHODS --
        *************************************************************************************/
        /************************* Architecure note:**********************************
        We have used the employeeId parameter as SqlInt32, to bind the delete method with object data source and view control directly.
        ****************************************************************************/
		[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
        public static  bool DeleteTblProductPurchaseOrder
		(
			Int32 orderId
		)
		{
			//Validate Input
			if(orderId <= GetOrderIdMinValue)
				throw (new ArgumentOutOfRangeException("orderId"));
				
			// Execute SQL Command
            SqlCommand sqlCmd = new SqlCommand();
			AddParameterToSqlCmd(sqlCmd, "@ReturnValue", SqlDbType.Int, 0, ParameterDirection.ReturnValue, null);
			AddParameterToSqlCmd(sqlCmd, "@OrderId",SqlDbType.Int, 0, ParameterDirection.Input, orderId);
			SetCommandType(sqlCmd,CommandType.StoredProcedure,SPR_TBLPRODUCTPURCHASEORDER_DELETETBLPRODUCTPURCHASEORDER);
			ExecuteScalarCmd(sqlCmd);
			int returnValue = (int)sqlCmd.Parameters["@ReturnValue"].Value;
			return (returnValue == 0 ? false : true);
			
		}
		
		/// <summary>
        /// Deletes a set of employees from the database.
        /// </summary>
		public static bool DeleteTblProductPurchaseOrderList( System.Collections.Generic.List<Int32>  orderIdListToDelete)
		{
			//Validate Input
			foreach (Int32 orderId in orderIdListToDelete)
			    if(orderId <= GetOrderIdMinValue)
					throw (new ArgumentOutOfRangeException("orderId"));
			
			//performing deletion operation //

            string xmlString = FormatXMLForIdArray(orderIdListToDelete);
			
			// Execute SQL Command
            SqlCommand sqlCmd = new SqlCommand();
			AddParameterToSqlCmd(sqlCmd, "@ReturnValue", SqlDbType.Int, 0, ParameterDirection.ReturnValue, null);
            AddParameterToSqlCmd(sqlCmd, "@OrderIdList", SqlDbType.Xml, xmlString.ToString().Length, ParameterDirection.Input, xmlString.ToString());
			SetCommandType(sqlCmd,CommandType.StoredProcedure,SPR_TBLPRODUCTPURCHASEORDER_DELETETBLPRODUCTPURCHASEORDERLIST);
			ExecuteScalarCmd(sqlCmd);
			int returnValue = (int)sqlCmd.Parameters["@ReturnValue"].Value;
			return (returnValue == orderIdListToDelete.Count ? true : false);
		}
		
		/************************************************************************************
                                 -- GET BY PRIMARY METHODS --
        *************************************************************************************/
        /************************* Architecure note:**********************************
        Retrives an Employee from database, based on it's primary key.
        To view or update an employee, everytime we must have to use this type of 'get' method, 
        since we don't have direct access to the Primary key value for assigning value.
        We have used the employeeId parameter as SqlInt32, to bind the delete method with object data source and view control directly.
        /*****************************************************************************/
		[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
		public static TblProductPurchaseOrder GetTblProductPurchaseOrderByOrderId(Int32 orderId)
		{
			if(orderId <= GetOrderIdMinValue)
					throw (new ArgumentOutOfRangeException("orderId"));
				
		 	// Execute SQL Command
			SqlCommand sqlCmd = new SqlCommand();
			AddParameterToSqlCmd(sqlCmd, "@OrderId",SqlDbType.Int, 0, ParameterDirection.Input, orderId);
			SetCommandType(sqlCmd,CommandType.StoredProcedure,SPR_TBLPRODUCTPURCHASEORDER_GETTBLPRODUCTPURCHASEORDERBYORDERID);
			GenerateCollectionFromReader test = new GenerateCollectionFromReader(GenerateTblProductPurchaseOrderCollectionFromReader);
            CustomCollection<TblProductPurchaseOrder> objCollection = ((CustomCollection<TblProductPurchaseOrder>)ExecuteReaderCmd(sqlCmd, test));

            if (objCollection.Count > 0)
                return objCollection[0];
            else
                return null;
		}
		
		/************************************************************************************
                         -- GET BY FOREIGN KEY METHODS --
        *************************************************************************************/
		
		/************************************************************************************
                 -- GET ALL METHODS --
        *************************************************************************************/
		[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
        public static CustomCollection<TblProductPurchaseOrder> GetAllTblProductPurchaseOrder()
		{
		
		 	// Execute SQL Command
            SqlCommand sqlCmd = new SqlCommand();
            SetCommandType(sqlCmd,CommandType.StoredProcedure,SPR_TBLPRODUCTPURCHASEORDER_GETALLTBLPRODUCTPURCHASEORDER);
            GenerateCollectionFromReader test = new GenerateCollectionFromReader(GenerateTblProductPurchaseOrderCollectionFromReader);
            CustomCollection<TblProductPurchaseOrder> objCollection = ((CustomCollection<TblProductPurchaseOrder>)ExecuteReaderCmd(sqlCmd, test));

            return objCollection;
		}
		
		[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
        public static CustomCollection<TblProductPurchaseOrder> GetAllTblProductPurchaseOrderPaged(String orderBy, Int32 startRowIndex, Int32 maximumRows)
        {
            //Validate Input
            if (orderBy == "")
                orderBy = "OrderId";

            // Execute SQL Command
            SqlCommand sqlCmd = new SqlCommand();
            AddParameterToSqlCmd(sqlCmd, "@orderby", SqlDbType.VarChar, 50, ParameterDirection.Input, orderBy);
            AddParameterToSqlCmd(sqlCmd, "@startrow", SqlDbType.Int, 0, ParameterDirection.Input, startRowIndex);
            AddParameterToSqlCmd(sqlCmd, "@pagesize", SqlDbType.Int, 0, ParameterDirection.Input, maximumRows);

            SetCommandType(sqlCmd,CommandType.StoredProcedure,SPR_TBLPRODUCTPURCHASEORDER_GETALLTBLPRODUCTPURCHASEORDERPAGED);

            GenerateCollectionFromReader test = new GenerateCollectionFromReader(GenerateTblProductPurchaseOrderCollectionFromReader);
            CustomCollection<TblProductPurchaseOrder> objCollection = ((CustomCollection<TblProductPurchaseOrder>)ExecuteReaderCmd(sqlCmd, test));
            return objCollection;
        }
		
		[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
        public static int GetAllTblProductPurchaseOrderPagedCount(String orderBy, Int32 startRowIndex, Int32 maximumRows)
        {
            // Execute SQL Command
            SqlCommand sqlCmd = new SqlCommand();

            AddParameterToSqlCmd(sqlCmd, "@ReturnValue", SqlDbType.Int, 0, ParameterDirection.ReturnValue, null);
            SetCommandType(sqlCmd,CommandType.StoredProcedure,SPR_TBLPRODUCTPURCHASEORDER_GETALLTBLPRODUCTPURCHASEORDERPAGEDCOUNT);
            ExecuteScalarCmd(sqlCmd);

            int returnValue = (int)sqlCmd.Parameters["@ReturnValue"].Value;
            return returnValue;
        }
		
		#endregion
		#region Employee Instance Methods
		/************************************************************************************
                                    -- SAVE (INSERT/UPDATE) METHODS (INSTANCE) --
        *************************************************************************************/
		/// <summary>
        /// Saves (inserts and updates) an Employee into database.
        /// The insertion occur if the EmployeeId conatins default value.
        /// Otherwises it updates the Employee into the database, based on the primary key value stored in EmployeeId.
        /// This technique ensures an Employee will not be updated without having a valid EmployeeId.
        /// </summary>
		public bool Save()
		{
			if(OrderId<= GetOrderIdMinValue)
			{
				Int32 TempId=CreateNewTblProductPurchaseOrder(this);
				if(TempId>0)
				{
					_orderId=TempId;
					return true;
				}
				else
				{
					// error occurs
					return false;
				}
			}
			else
			{	//This is a update Command
				return (UpdateTblProductPurchaseOrder(this));
			}
			
		}
		
		public static Int32 CreateNewTblProductPurchaseOrder(TblProductPurchaseOrder newTblProductPurchaseOrder)
		{
			// validate Parameters
			if (newTblProductPurchaseOrder == null)
				throw (new ArgumentNullException("newTblProductPurchaseOrder"));

			// Execute SQL Command
			SqlCommand sqlCmd = new SqlCommand();
			int length = 0;
			AddParameterToSqlCmd(sqlCmd, "@ReturnValue", SqlDbType.Int, 0, ParameterDirection.ReturnValue, null);
            
			AddParameterToSqlCmd(sqlCmd, "@OrderCode",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.OrderCode);
			AddParameterToSqlCmd(sqlCmd, "@FirstName",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.FirstName);
			AddParameterToSqlCmd(sqlCmd, "@LastName",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.LastName);
			AddParameterToSqlCmd(sqlCmd, "@DateOfBirth",SqlDbType.DateTime, 0, ParameterDirection.Input, newTblProductPurchaseOrder.DateOfBirth);
			AddParameterToSqlCmd(sqlCmd, "@EmailAddress",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.EmailAddress);
			AddParameterToSqlCmd(sqlCmd, "@UserGender",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.UserGender);
			AddParameterToSqlCmd(sqlCmd, "@UserTelephoneNumber",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.UserTelephoneNumber);
			AddParameterToSqlCmd(sqlCmd, "@UserFaxNumber",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.UserFaxNumber);
			AddParameterToSqlCmd(sqlCmd, "@CompanyName",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.CompanyName);
			AddParameterToSqlCmd(sqlCmd, "@CompanyTelephoneNumber",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.CompanyTelephoneNumber);
			AddParameterToSqlCmd(sqlCmd, "@CompanyFaxNumber",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.CompanyFaxNumber);
			AddParameterToSqlCmd(sqlCmd, "@BillingFirstName",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.BillingFirstName);
			AddParameterToSqlCmd(sqlCmd, "@BillingLastName",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.BillingLastName);
			AddParameterToSqlCmd(sqlCmd, "@BillingAddressLine1",SqlDbType.NVarChar, 4000, ParameterDirection.Input, newTblProductPurchaseOrder.BillingAddressLine1);
			AddParameterToSqlCmd(sqlCmd, "@BillingAddressLine2",SqlDbType.NVarChar, 4000, ParameterDirection.Input, newTblProductPurchaseOrder.BillingAddressLine2);
			AddParameterToSqlCmd(sqlCmd, "@BillingCity",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.BillingCity);
			AddParameterToSqlCmd(sqlCmd, "@BillingAddressState",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.BillingAddressState);
			AddParameterToSqlCmd(sqlCmd, "@BillingAddressCountry",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.BillingAddressCountry);
			AddParameterToSqlCmd(sqlCmd, "@BillingZipCode",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.BillingZipCode);
			AddParameterToSqlCmd(sqlCmd, "@BillingTelephoneNumber",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.BillingTelephoneNumber);
			AddParameterToSqlCmd(sqlCmd, "@BillingTelephoneNumber2",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.BillingTelephoneNumber2);
			AddParameterToSqlCmd(sqlCmd, "@BillingEmailAddress",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.BillingEmailAddress);
			AddParameterToSqlCmd(sqlCmd, "@ShippingFirstName",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingFirstName);
			AddParameterToSqlCmd(sqlCmd, "@ShippingLastName",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingLastName);
			AddParameterToSqlCmd(sqlCmd, "@ShippingAddressLine1",SqlDbType.NVarChar, 4000, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingAddressLine1);
			AddParameterToSqlCmd(sqlCmd, "@ShippingAddressLine2",SqlDbType.NVarChar, 4000, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingAddressLine2);
			AddParameterToSqlCmd(sqlCmd, "@ShippingCity",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingCity);
			AddParameterToSqlCmd(sqlCmd, "@ShippingAddressState",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingAddressState);
			AddParameterToSqlCmd(sqlCmd, "@ShippingAddressCountry",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingAddressCountry);
			AddParameterToSqlCmd(sqlCmd, "@ShippingZipCode",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingZipCode);
			AddParameterToSqlCmd(sqlCmd, "@ShippingTelephoneNumber",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingTelephoneNumber);
			AddParameterToSqlCmd(sqlCmd, "@ShippingTelephoneNumber2",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingTelephoneNumber2);
			AddParameterToSqlCmd(sqlCmd, "@ShippingEmailAddress",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingEmailAddress);
			AddParameterToSqlCmd(sqlCmd, "@CreateDate",SqlDbType.DateTime, 0, ParameterDirection.Input, newTblProductPurchaseOrder.CreateDate);
			AddParameterToSqlCmd(sqlCmd, "@PaymentType",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.PaymentType);
			AddParameterToSqlCmd(sqlCmd, "@ShippingMethod",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingMethod);
			AddParameterToSqlCmd(sqlCmd, "@CreditCardId",SqlDbType.Int, 0, ParameterDirection.Input, newTblProductPurchaseOrder.CreditCardId);
			AddParameterToSqlCmd(sqlCmd, "@GiftCertificateId",SqlDbType.Int, 0, ParameterDirection.Input, newTblProductPurchaseOrder.GiftCertificateId);
			AddParameterToSqlCmd(sqlCmd, "@OrderPrice",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblProductPurchaseOrder.OrderPrice);
			AddParameterToSqlCmd(sqlCmd, "@PaymentByCreditCard",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblProductPurchaseOrder.PaymentByCreditCard);
			AddParameterToSqlCmd(sqlCmd, "@PaymentByGiftCertificate",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblProductPurchaseOrder.PaymentByGiftCertificate);
			AddParameterToSqlCmd(sqlCmd, "@TaxAmount",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblProductPurchaseOrder.TaxAmount);
			AddParameterToSqlCmd(sqlCmd, "@ShippingCost",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingCost);
			AddParameterToSqlCmd(sqlCmd, "@ShippingStatus",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingStatus);
			AddParameterToSqlCmd(sqlCmd, "@OrderStatus",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.OrderStatus);
			AddParameterToSqlCmd(sqlCmd, "@OrderStatusMessage",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.OrderStatusMessage);
			AddParameterToSqlCmd(sqlCmd, "@OrderStatusCode",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.OrderStatusCode);
			AddParameterToSqlCmd(sqlCmd, "@OrderTrackNumber",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.OrderTrackNumber);
			AddParameterToSqlCmd(sqlCmd, "@SpecialInstruction",SqlDbType.NVarChar, 4000, ParameterDirection.Input, newTblProductPurchaseOrder.SpecialInstruction);
			AddParameterToSqlCmd(sqlCmd, "@CouponDiscount",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblProductPurchaseOrder.CouponDiscount);
			AddParameterToSqlCmd(sqlCmd, "@GiftCardImageUrl",SqlDbType.NVarChar, 4000, ParameterDirection.Input, newTblProductPurchaseOrder.GiftCardImageUrl);
			AddParameterToSqlCmd(sqlCmd, "@GIftCardMessage",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.GIftCardMessage);
			AddParameterToSqlCmd(sqlCmd, "@OfficeUse",SqlDbType.NVarChar, -1, ParameterDirection.Input, newTblProductPurchaseOrder.OfficeUse);
			AddParameterToSqlCmd(sqlCmd, "@IsMultipleShip",SqlDbType.Bit, 0, ParameterDirection.Input, newTblProductPurchaseOrder.IsMultipleShip);
			AddParameterToSqlCmd(sqlCmd, "@IsResidential",SqlDbType.Bit, 0, ParameterDirection.Input, newTblProductPurchaseOrder.IsResidential);
			AddParameterToSqlCmd(sqlCmd, "@RequestedDeliveryDate",SqlDbType.DateTime, 0, ParameterDirection.Input, newTblProductPurchaseOrder.RequestedDeliveryDate);
			AddParameterToSqlCmd(sqlCmd, "@PrintNo",SqlDbType.Int, 0, ParameterDirection.Input, newTblProductPurchaseOrder.PrintNo);
			AddParameterToSqlCmd(sqlCmd, "@Substitute",SqlDbType.NVarChar, 200, ParameterDirection.Input, newTblProductPurchaseOrder.Substitute);
			AddParameterToSqlCmd(sqlCmd, "@SPId",SqlDbType.Int, 0, ParameterDirection.Input, newTblProductPurchaseOrder.SPId);
			AddParameterToSqlCmd(sqlCmd, "@SPName",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.SPName);
			
			SetCommandType(sqlCmd,CommandType.StoredProcedure,SPR_TBLPRODUCTPURCHASEORDER_CREATENEWTBLPRODUCTPURCHASEORDER);
			ExecuteScalarCmd(sqlCmd);
			return (Int32.Parse(sqlCmd.Parameters["@ReturnValue"].Value.ToString()));

		}
		/// <summary>
        /// Updates an TblProductPurchaseOrder instance to the database.
        /// </summary>
		public static bool UpdateTblProductPurchaseOrder(TblProductPurchaseOrder newTblProductPurchaseOrder)
		{
			// validate Parameters
			if (newTblProductPurchaseOrder == null)
				throw (new ArgumentNullException("newTblProductPurchaseOrder"));

			// Execute SQL Command
			SqlCommand sqlCmd = new SqlCommand();
			int length = 0;
			AddParameterToSqlCmd(sqlCmd, "@ReturnValue", SqlDbType.Int, 0, ParameterDirection.ReturnValue, null);
            
			AddParameterToSqlCmd(sqlCmd, "@OrderId",SqlDbType.Int, 0, ParameterDirection.Input, newTblProductPurchaseOrder.OrderId);
			AddParameterToSqlCmd(sqlCmd, "@OrderCode",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.OrderCode);
			AddParameterToSqlCmd(sqlCmd, "@FirstName",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.FirstName);
			AddParameterToSqlCmd(sqlCmd, "@LastName",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.LastName);
			AddParameterToSqlCmd(sqlCmd, "@DateOfBirth",SqlDbType.DateTime, 0, ParameterDirection.Input, newTblProductPurchaseOrder.DateOfBirth);
			AddParameterToSqlCmd(sqlCmd, "@EmailAddress",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.EmailAddress);
			AddParameterToSqlCmd(sqlCmd, "@UserGender",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.UserGender);
			AddParameterToSqlCmd(sqlCmd, "@UserTelephoneNumber",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.UserTelephoneNumber);
			AddParameterToSqlCmd(sqlCmd, "@UserFaxNumber",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.UserFaxNumber);
			AddParameterToSqlCmd(sqlCmd, "@CompanyName",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.CompanyName);
			AddParameterToSqlCmd(sqlCmd, "@CompanyTelephoneNumber",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.CompanyTelephoneNumber);
			AddParameterToSqlCmd(sqlCmd, "@CompanyFaxNumber",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.CompanyFaxNumber);
			AddParameterToSqlCmd(sqlCmd, "@BillingFirstName",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.BillingFirstName);
			AddParameterToSqlCmd(sqlCmd, "@BillingLastName",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.BillingLastName);
			AddParameterToSqlCmd(sqlCmd, "@BillingAddressLine1",SqlDbType.NVarChar, 4000, ParameterDirection.Input, newTblProductPurchaseOrder.BillingAddressLine1);
			AddParameterToSqlCmd(sqlCmd, "@BillingAddressLine2",SqlDbType.NVarChar, 4000, ParameterDirection.Input, newTblProductPurchaseOrder.BillingAddressLine2);
			AddParameterToSqlCmd(sqlCmd, "@BillingCity",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.BillingCity);
			AddParameterToSqlCmd(sqlCmd, "@BillingAddressState",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.BillingAddressState);
			AddParameterToSqlCmd(sqlCmd, "@BillingAddressCountry",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.BillingAddressCountry);
			AddParameterToSqlCmd(sqlCmd, "@BillingZipCode",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.BillingZipCode);
			AddParameterToSqlCmd(sqlCmd, "@BillingTelephoneNumber",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.BillingTelephoneNumber);
			AddParameterToSqlCmd(sqlCmd, "@BillingTelephoneNumber2",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.BillingTelephoneNumber2);
			AddParameterToSqlCmd(sqlCmd, "@BillingEmailAddress",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.BillingEmailAddress);
			AddParameterToSqlCmd(sqlCmd, "@ShippingFirstName",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingFirstName);
			AddParameterToSqlCmd(sqlCmd, "@ShippingLastName",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingLastName);
			AddParameterToSqlCmd(sqlCmd, "@ShippingAddressLine1",SqlDbType.NVarChar, 4000, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingAddressLine1);
			AddParameterToSqlCmd(sqlCmd, "@ShippingAddressLine2",SqlDbType.NVarChar, 4000, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingAddressLine2);
			AddParameterToSqlCmd(sqlCmd, "@ShippingCity",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingCity);
			AddParameterToSqlCmd(sqlCmd, "@ShippingAddressState",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingAddressState);
			AddParameterToSqlCmd(sqlCmd, "@ShippingAddressCountry",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingAddressCountry);
			AddParameterToSqlCmd(sqlCmd, "@ShippingZipCode",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingZipCode);
			AddParameterToSqlCmd(sqlCmd, "@ShippingTelephoneNumber",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingTelephoneNumber);
			AddParameterToSqlCmd(sqlCmd, "@ShippingTelephoneNumber2",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingTelephoneNumber2);
			AddParameterToSqlCmd(sqlCmd, "@ShippingEmailAddress",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingEmailAddress);
			AddParameterToSqlCmd(sqlCmd, "@CreateDate",SqlDbType.DateTime, 0, ParameterDirection.Input, newTblProductPurchaseOrder.CreateDate);
			AddParameterToSqlCmd(sqlCmd, "@PaymentType",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.PaymentType);
			AddParameterToSqlCmd(sqlCmd, "@ShippingMethod",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingMethod);
			AddParameterToSqlCmd(sqlCmd, "@CreditCardId",SqlDbType.Int, 0, ParameterDirection.Input, newTblProductPurchaseOrder.CreditCardId);
			AddParameterToSqlCmd(sqlCmd, "@GiftCertificateId",SqlDbType.Int, 0, ParameterDirection.Input, newTblProductPurchaseOrder.GiftCertificateId);
			AddParameterToSqlCmd(sqlCmd, "@OrderPrice",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblProductPurchaseOrder.OrderPrice);
			AddParameterToSqlCmd(sqlCmd, "@PaymentByCreditCard",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblProductPurchaseOrder.PaymentByCreditCard);
			AddParameterToSqlCmd(sqlCmd, "@PaymentByGiftCertificate",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblProductPurchaseOrder.PaymentByGiftCertificate);
			AddParameterToSqlCmd(sqlCmd, "@TaxAmount",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblProductPurchaseOrder.TaxAmount);
			AddParameterToSqlCmd(sqlCmd, "@ShippingCost",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingCost);
			AddParameterToSqlCmd(sqlCmd, "@ShippingStatus",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.ShippingStatus);
			AddParameterToSqlCmd(sqlCmd, "@OrderStatus",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.OrderStatus);
			AddParameterToSqlCmd(sqlCmd, "@OrderStatusMessage",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.OrderStatusMessage);
			AddParameterToSqlCmd(sqlCmd, "@OrderStatusCode",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.OrderStatusCode);
			AddParameterToSqlCmd(sqlCmd, "@OrderTrackNumber",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.OrderTrackNumber);
			AddParameterToSqlCmd(sqlCmd, "@SpecialInstruction",SqlDbType.NVarChar, 4000, ParameterDirection.Input, newTblProductPurchaseOrder.SpecialInstruction);
			AddParameterToSqlCmd(sqlCmd, "@CouponDiscount",SqlDbType.Decimal, 9, ParameterDirection.Input, newTblProductPurchaseOrder.CouponDiscount);
			AddParameterToSqlCmd(sqlCmd, "@GiftCardImageUrl",SqlDbType.NVarChar, 4000, ParameterDirection.Input, newTblProductPurchaseOrder.GiftCardImageUrl);
			AddParameterToSqlCmd(sqlCmd, "@GIftCardMessage",SqlDbType.NVarChar, 500, ParameterDirection.Input, newTblProductPurchaseOrder.GIftCardMessage);
			AddParameterToSqlCmd(sqlCmd, "@OfficeUse",SqlDbType.NVarChar, -1, ParameterDirection.Input, newTblProductPurchaseOrder.OfficeUse);
			AddParameterToSqlCmd(sqlCmd, "@IsMultipleShip",SqlDbType.Bit, 0, ParameterDirection.Input, newTblProductPurchaseOrder.IsMultipleShip);
			AddParameterToSqlCmd(sqlCmd, "@IsResidential",SqlDbType.Bit, 0, ParameterDirection.Input, newTblProductPurchaseOrder.IsResidential);
			AddParameterToSqlCmd(sqlCmd, "@RequestedDeliveryDate",SqlDbType.DateTime, 0, ParameterDirection.Input, newTblProductPurchaseOrder.RequestedDeliveryDate);
			AddParameterToSqlCmd(sqlCmd, "@PrintNo",SqlDbType.Int, 0, ParameterDirection.Input, newTblProductPurchaseOrder.PrintNo);
			AddParameterToSqlCmd(sqlCmd, "@Substitute",SqlDbType.NVarChar, 200, ParameterDirection.Input, newTblProductPurchaseOrder.Substitute);
			AddParameterToSqlCmd(sqlCmd, "@SPId",SqlDbType.Int, 0, ParameterDirection.Input, newTblProductPurchaseOrder.SPId);
			AddParameterToSqlCmd(sqlCmd, "@SPName",SqlDbType.NVarChar, 50, ParameterDirection.Input, newTblProductPurchaseOrder.SPName);
			
			SetCommandType(sqlCmd,CommandType.StoredProcedure,SPR_TBLPRODUCTPURCHASEORDER_UPDATETBLPRODUCTPURCHASEORDER);
            ExecuteScalarCmd(sqlCmd);
			int returnValue = (int)sqlCmd.Parameters["@ReturnValue"].Value;
			return (returnValue == 0 ? false : true);
		}
		#endregion
		
		#region TblProductPurchaseOrder Related Collections
		/// <summary>
        /// Creates and returns a strongly typed collection of Employee custom entity. 
        /// The colelction is created through iterating on the IdataReader object which contains Employee information, as a set of records, similar to tabular format.
        /// </summary>
		public static CollectionBase  GenerateTblProductPurchaseOrderCollectionFromReader(IDataReader returnData) 
		{
			
			//creating the instance of Employee collection
			CustomCollection<TblProductPurchaseOrder> colTblProductPurchaseOrder = new CustomCollection<TblProductPurchaseOrder>();
			
			/************************* Architecure note:**********************************
             * Below code includes the null value functionality to retieve the data which has nill value in database end.
             * Design consideration:
             * Besides general data fields, special care should be taken for primary keys, to assign '0'/defaultvalue, rather passing 'Null' value in constructor parameter.
             * Although we are considering sqldb tyoe data for the current data container, but while retireving data from database end, through datareader object, we need to cast data reader objects using .net primitive data type, 
             * rather using sqldb type to cast, since data reader objects don't support sql db type to be casted.
             *****************************************************************************/

            //Iterating thriugh the data reader, to generate Employee collection.

			//getting the Employee collection by iterating thru the data reader
			while (returnData.Read()) 
			{
				//passing the TblProductPurchaseOrder constructor parameters from the current instance of data reader fields.
				TblProductPurchaseOrder newTblProductPurchaseOrder = new TblProductPurchaseOrder
				(
					returnData["OrderId"]== System.DBNull.Value ? GetOrderIdMinValue : (Int32 ) returnData["OrderId"],
					returnData["OrderCode"]== System.DBNull.Value ? string.Empty: (String ) returnData["OrderCode"],
					returnData["FirstName"]== System.DBNull.Value ? string.Empty: (String ) returnData["FirstName"],
					returnData["LastName"]== System.DBNull.Value ? string.Empty: (String ) returnData["LastName"],
					returnData["DateOfBirth"]== System.DBNull.Value ? DateTime.MinValue: (DateTime ) returnData["DateOfBirth"],
					returnData["EmailAddress"]== System.DBNull.Value ? string.Empty: (String ) returnData["EmailAddress"],
					returnData["UserGender"]== System.DBNull.Value ? string.Empty: (String ) returnData["UserGender"],
					returnData["UserTelephoneNumber"]== System.DBNull.Value ? string.Empty: (String ) returnData["UserTelephoneNumber"],
					returnData["UserFaxNumber"]== System.DBNull.Value ? string.Empty: (String ) returnData["UserFaxNumber"],
					returnData["CompanyName"]== System.DBNull.Value ? string.Empty: (String ) returnData["CompanyName"],
					returnData["CompanyTelephoneNumber"]== System.DBNull.Value ? string.Empty: (String ) returnData["CompanyTelephoneNumber"],
					returnData["CompanyFaxNumber"]== System.DBNull.Value ? string.Empty: (String ) returnData["CompanyFaxNumber"],
					returnData["BillingFirstName"]== System.DBNull.Value ? string.Empty: (String ) returnData["BillingFirstName"],
					returnData["BillingLastName"]== System.DBNull.Value ? string.Empty: (String ) returnData["BillingLastName"],
					returnData["BillingAddressLine1"]== System.DBNull.Value ? string.Empty: (String ) returnData["BillingAddressLine1"],
					returnData["BillingAddressLine2"]== System.DBNull.Value ? string.Empty: (String ) returnData["BillingAddressLine2"],
					returnData["BillingCity"]== System.DBNull.Value ? string.Empty: (String ) returnData["BillingCity"],
					returnData["BillingAddressState"]== System.DBNull.Value ? string.Empty: (String ) returnData["BillingAddressState"],
					returnData["BillingAddressCountry"]== System.DBNull.Value ? string.Empty: (String ) returnData["BillingAddressCountry"],
					returnData["BillingZipCode"]== System.DBNull.Value ? string.Empty: (String ) returnData["BillingZipCode"],
					returnData["BillingTelephoneNumber"]== System.DBNull.Value ? string.Empty: (String ) returnData["BillingTelephoneNumber"],
					returnData["BillingTelephoneNumber2"]== System.DBNull.Value ? string.Empty: (String ) returnData["BillingTelephoneNumber2"],
					returnData["BillingEmailAddress"]== System.DBNull.Value ? string.Empty: (String ) returnData["BillingEmailAddress"],
					returnData["ShippingFirstName"]== System.DBNull.Value ? string.Empty: (String ) returnData["ShippingFirstName"],
					returnData["ShippingLastName"]== System.DBNull.Value ? string.Empty: (String ) returnData["ShippingLastName"],
					returnData["ShippingAddressLine1"]== System.DBNull.Value ? string.Empty: (String ) returnData["ShippingAddressLine1"],
					returnData["ShippingAddressLine2"]== System.DBNull.Value ? string.Empty: (String ) returnData["ShippingAddressLine2"],
					returnData["ShippingCity"]== System.DBNull.Value ? string.Empty: (String ) returnData["ShippingCity"],
					returnData["ShippingAddressState"]== System.DBNull.Value ? string.Empty: (String ) returnData["ShippingAddressState"],
					returnData["ShippingAddressCountry"]== System.DBNull.Value ? string.Empty: (String ) returnData["ShippingAddressCountry"],
					returnData["ShippingZipCode"]== System.DBNull.Value ? string.Empty: (String ) returnData["ShippingZipCode"],
					returnData["ShippingTelephoneNumber"]== System.DBNull.Value ? string.Empty: (String ) returnData["ShippingTelephoneNumber"],
					returnData["ShippingTelephoneNumber2"]== System.DBNull.Value ? string.Empty: (String ) returnData["ShippingTelephoneNumber2"],
					returnData["ShippingEmailAddress"]== System.DBNull.Value ? string.Empty: (String ) returnData["ShippingEmailAddress"],
					returnData["CreateDate"]== System.DBNull.Value ? DateTime.MinValue: (DateTime ) returnData["CreateDate"],
					returnData["PaymentType"]== System.DBNull.Value ? string.Empty: (String ) returnData["PaymentType"],
					returnData["ShippingMethod"]== System.DBNull.Value ? string.Empty: (String ) returnData["ShippingMethod"],
					returnData["CreditCardId"]== System.DBNull.Value ? 0: (Int32 ) returnData["CreditCardId"],
					returnData["GiftCertificateId"]== System.DBNull.Value ? 0: (Int32 ) returnData["GiftCertificateId"],
					returnData["OrderPrice"]== System.DBNull.Value ? 0: (Decimal ) returnData["OrderPrice"],
					returnData["PaymentByCreditCard"]== System.DBNull.Value ? 0: (Decimal ) returnData["PaymentByCreditCard"],
					returnData["PaymentByGiftCertificate"]== System.DBNull.Value ? 0: (Decimal ) returnData["PaymentByGiftCertificate"],
					returnData["TaxAmount"]== System.DBNull.Value ? 0: (Decimal ) returnData["TaxAmount"],
					returnData["ShippingCost"]== System.DBNull.Value ? 0: (Decimal ) returnData["ShippingCost"],
					returnData["ShippingStatus"]== System.DBNull.Value ? string.Empty: (String ) returnData["ShippingStatus"],
					returnData["OrderStatus"]== System.DBNull.Value ? string.Empty: (String ) returnData["OrderStatus"],
					returnData["OrderStatusMessage"]== System.DBNull.Value ? string.Empty: (String ) returnData["OrderStatusMessage"],
					returnData["OrderStatusCode"]== System.DBNull.Value ? string.Empty: (String ) returnData["OrderStatusCode"],
					returnData["OrderTrackNumber"]== System.DBNull.Value ? string.Empty: (String ) returnData["OrderTrackNumber"],
					returnData["SpecialInstruction"]== System.DBNull.Value ? string.Empty: (String ) returnData["SpecialInstruction"],
					returnData["CouponDiscount"]== System.DBNull.Value ? 0: (Decimal ) returnData["CouponDiscount"],
					returnData["GiftCardImageUrl"]== System.DBNull.Value ? string.Empty: (String ) returnData["GiftCardImageUrl"],
					returnData["GIftCardMessage"]== System.DBNull.Value ? string.Empty: (String ) returnData["GIftCardMessage"],
					returnData["OfficeUse"]== System.DBNull.Value ? string.Empty: (String ) returnData["OfficeUse"],
					returnData["IsMultipleShip"]== System.DBNull.Value ? false: (Boolean ) returnData["IsMultipleShip"],
					returnData["IsResidential"]== System.DBNull.Value ? false: (Boolean ) returnData["IsResidential"],
					returnData["RequestedDeliveryDate"]== System.DBNull.Value ? DateTime.MinValue: (DateTime ) returnData["RequestedDeliveryDate"],
					returnData["PrintNo"]== System.DBNull.Value ? 0: (Int32 ) returnData["PrintNo"],
					returnData["Substitute"]== System.DBNull.Value ? string.Empty: (String ) returnData["Substitute"],
					returnData["SPId"]== System.DBNull.Value ? 0: (Int32 ) returnData["SPId"],
					returnData["SPName"]== System.DBNull.Value ? string.Empty: (String ) returnData["SPName"]

				);
				//adding the Employee to the collection
				colTblProductPurchaseOrder.Add(newTblProductPurchaseOrder);
			}
			
			//returns the collection of Companys 
			return (colTblProductPurchaseOrder);
		}
		
		#endregion
		#region Constants and Default Values
		
		public static Int32 GetOrderIdMinValue
		{
			get
			{
				return 0;
			}
		}
		
		//create method related contants
			internal const string SPR_TBLPRODUCTPURCHASEORDER_CREATENEWTBLPRODUCTPURCHASEORDER="spr_TblProductPurchaseOrder_CreateNewTblProductPurchaseOrder";
			internal const string SPR_TBLPRODUCTPURCHASEORDER_UPDATETBLPRODUCTPURCHASEORDER="spr_TblProductPurchaseOrder_UpdateTblProductPurchaseOrder";
			internal const string SPR_TBLPRODUCTPURCHASEORDER_DELETETBLPRODUCTPURCHASEORDER="spr_TblProductPurchaseOrder_DeleteTblProductPurchaseOrder";
			internal const string SPR_TBLPRODUCTPURCHASEORDER_DELETETBLPRODUCTPURCHASEORDERLIST="spr_TblProductPurchaseOrder_DeleteTblProductPurchaseOrderList";
			internal const string SPR_TBLPRODUCTPURCHASEORDER_GETTBLPRODUCTPURCHASEORDERBYORDERID="spr_TblProductPurchaseOrder_GetTblProductPurchaseOrderByOrderId";
			internal const string SPR_TBLPRODUCTPURCHASEORDER_GETALLTBLPRODUCTPURCHASEORDER="spr_TblProductPurchaseOrder_GetAllTblProductPurchaseOrder";
			internal const string SPR_TBLPRODUCTPURCHASEORDER_GETALLTBLPRODUCTPURCHASEORDERPAGED="spr_TblProductPurchaseOrder_GetAllTblProductPurchaseOrderPaged";
			internal const string SPR_TBLPRODUCTPURCHASEORDER_GETALLTBLPRODUCTPURCHASEORDERPAGEDCOUNT="spr_TblProductPurchaseOrder_GetAllTblProductPurchaseOrderPagedCount";
		
		#endregion
	}
}	
